package com.zzq.demo.tio.common;

import org.tio.core.intf.Packet;

/**
 * @author : zhaoziqian
 * @description : TODO
 * @date : 2019/10/23 10:23 下午
 **/
public class HelloPacket extends Packet {
    private static final long serialVersionUID = -172060606924066412L;
    /**
     * 消息头的长度 1+4
     */
    public static final int HEADER_LENGTH = 5;
    public static final String CHARSET = "utf-8";

    /**
     * 消息类型
     */
    private byte type;

    private byte[] body;

    public HelloPacket() {
    }

    public HelloPacket(byte type, byte[] body) {
        super();
        this.type = type;
        this.body = body;
    }

    public byte getType() {
        return type;
    }

    public void setType(byte type) {
        this.type = type;
    }

    @Override
    public String logstr() {
        return "" + type;
    }

    public byte[] getBody() {
        return body;
    }

    public void setBody(byte[] body) {
        this.body = body;
    }
}
